from google.appengine.ext import db
from google.appengine.ext import bulkload
from google.appengine.api import datastore_types
from google.appengine.ext import search

class PersonLoader(bulkload.Loader):
  def __init__(self):
    # "AE","United Arab Emirates","","united_arab_emirates_e.htm",49,2344402
    bulkload.Loader.__init__(self, 'Member',
                         [('iso', str),
			  ('name',str),
			  ('formal_name',str),
			  ('wto_url',str),
			  ('hdi',int),
			  ('population',int),
			  ('location', lambda x: db.GeoPt(x.split(":")[0],x.split(":")[1]))
                          ])

  #def HandleEntity(self, entity):
  #  ent = search.SearchableEntity(entity)
  #  return ent

if __name__ == '__main__':
  bulkload.main(PersonLoader())
